package org.csu.gp_store.common;

import lombok.Getter;

@Getter
public enum AccountStatus {
    regular("正常", 1),
    verifying("审核中", 2),
    freezing("冻结中", 3),
    canceled("已注销", 4);

    private String description;
    private int index;

    AccountStatus(String description, int index) {
        this.description = description;
        this.index = index;
    }

    public static String getDescription(int index) {
        for (AccountStatus status : AccountStatus.values()) {
            if (status.getIndex() == index) {
                return status.getDescription();
            }
        }
        return "error";
    }
}
